import { createRouter, createWebHistory } from 'vue-router'

import LoginView from '../views/LoginView.vue'

import RegisterView from '../views/RegisterView.vue'

const router = createRouter({
    history: createWebHistory(
        import.meta.env.BASE_URL),
    routes: [{
            path: '/',
            name: 'login',
            component: LoginView
        },
        {
            path: '/register',
            name: 'register',
            component: RegisterView
        },
        {
            path: '/navigation',
            name: 'Navigation',
            component: () =>
                import ('../views/NavigationView.vue'),
            children: [{
                    path: '/home',
                    name: 'Home',
                    component: () =>
                        import ('../views/HomeView.vue'),
                },
                {
                    path: '/user',
                    name: 'User',
                    component: () =>
                        import ('../views/UserView.vue'),
                },
                {
                    path: '/role',
                    name: 'Role',
                    component: () =>
                        import ('../views/RoleView.vue'),
                },
                {
                    path: '/menu',
                    name: 'Menu',
                    component: () =>
                        import ('../views/MenuView.vue'),
                },
                {
                    path: '/about',
                    name: 'about',
                    component: () =>
                        import ('../views/AboutView.vue'),
                },
                {
                    path: '/hello',
                    name: 'hello',
                    component: () =>
                        import ('../views/HelloView.vue'),
                },
                {
                    path: '/position',
                    name: 'position',
                    component: () =>
                        import ('../views/PositionView.vue'),
                },
                {
                    path: '/device',
                    name: 'device',
                    component: () =>
                        import ('../views/DeviceView.vue'),
                },
                {
                    path: '/data',
                    name: 'data',
                    component: () =>
                        import ('../views/DataView.vue'),
                },
                {
                    path: '/myInfo',
                    name: 'myInfo',
                    component: () =>
                        import ('../views/MyInfoView.vue'),
                }
            ]
        },

    ]
})

export default router